package NiuKe;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.util.Scanner;

/**
 * 3.游游的整数操作
 * 游游拿到了一个数组，她有两种操作；
 * 1.输入1X,代表所有数加x。
 * 2.输入2x,代表所有数减x,同时将所有的负数变成0。即对于每个a',把a'变成m0x(a”一心，0)
 * 9
 * 游游在操作结束后，希望你能告诉她所有数之和，答案对10十7取模。
 */
public class IntegerOperations {
    public static void main(String[] args) {
        try (BufferedInputStream inBuffer = new BufferedInputStream(System.in)) {
            Scanner scanner = new Scanner(inBuffer);
            int n = scanner.nextInt();
            int k = scanner.nextInt();
            int[] nums = new int[n];
            for (int i = 0; i < n; i++) {
                nums[i] = scanner.nextInt();
            }
            for (int i = 0; i < k; i++) {
                int l = scanner.nextInt();
                int m = scanner.nextInt();
                if(l == 1){
                    for (int u = 0; u < nums.length; u++) {
                        nums[u] = nums[u] + m;
                    }
                }else{
                    for (int u = 0; u < nums.length; u++) {
                        nums[u] = Math.max(nums[u] - m,0);
                    }
                }
            }
            for (int i = 0; i < nums.length; i++) {
                System.out.println(nums[i]);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
